package com.vrv.netmgr.database.dao;

import java.sql.SQLException;
import java.util.Map;
import android.annotation.SuppressLint;
import android.content.ContentValues;
import android.database.sqlite.SQLiteDatabase;
import android.util.Log;
import com.j256.ormlite.dao.Dao;
import com.vrv.common.GlobalConstants;
import com.vrv.netmgr.EdpApplication;
import com.vrv.netmgr.database.table.EquipmentChanged;

@SuppressLint("DefaultLocale")
public class EquipmentChangedDao {
    private static final String TAG = EquipmentChangedDao.class.getSimpleName();
    private static final boolean DEBUG = true && GlobalConstants.DEBUG;

    private static Dao<EquipmentChanged, Integer> mDao;

    public static Dao<EquipmentChanged, Integer> getmDao() {
        try {
            mDao = EdpApplication.getsEdpApp().getDatabaseHelper().getDao(EquipmentChanged.class);
        } catch (SQLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return mDao;
    }

    public static void save(ContentValues values) {
        if (DEBUG)
            Log.e(TAG, "save()");

        SQLiteDatabase db = EdpApplication.getsEdpApp().getSQLiteDatabase();
        db.insert("EquipmentChanged".toLowerCase(), null, values);

    }

    /**
     * 删除所有记录
     */
    @SuppressLint("DefaultLocale")
    public static void deleteAll() {
        if (DEBUG)
            Log.v(TAG, "deleteAll()");

        String sql = "DELETE FROM " + "EquipmentChanged".toLowerCase();
        SQLiteDatabase db = EdpApplication.getsEdpApp().getSQLiteDatabase();
        db.execSQL(sql);
    }

    public static String select(Map<String, String> map) {
        String response = "";

        return response;
    }
}
